<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script type="text/javascript" src="jquery-1.11.3.js"></script>
    <script type="text/javascript">
        function fuc() {
            var input_data = document.getElementById("input_data");
            var output_data = document.getElementById("output_data");

            //var data = $.base64Encode( input_data.value );

            $.ajax({
                type: "POST",
                url: "translate_url_fuc.php", //
                data: "data=" + data,
                success: function (msg) {
                    var result = msg;
                    console.log(result);

                    output_data.value = msg;

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    console.log("失败");
                }
            });

        }

    </script>


</head>
<body>

<div>
    url:编码
    <input type="text" id="input_data"/>
    <br/>
    <input type="button" onclick="fuc()" value="提交"/>
    <br/>

    url:解码
    <input type="text" id="output_data"/>
</div>


</body>
</html>